package Demo3;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
//        Student student1=new Student("zhangsan",10);
//        Student student2=new Student("lis",9);
//        System.out.println(student1.compareTo(student2));
        Student[] students=new Student[3];
        students[0]=new Student("zhangsan",10);
        students[1]=new Student("li",19);
        students[2]=new Student("wang",4);
        System.out.println("排序前"+Arrays.toString(students));
        Arrays.sort(students);
        System.out.println("排序后"+Arrays.toString(students));
    }
}
